Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keymirror

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keymirror

A simple utility for creating an object with values equal to its keys. Identical to react/lib/keyMirror

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
102K
decreased by-58.94%
Maintainers
1
Weekly downloads
 
Created

What is keymirror?

The keymirror npm package is a utility that creates an object with values mirroring its keys. This is particularly useful for defining constants, especially in scenarios like Redux action types, where you want to avoid typos and ensure consistency.

What are keymirror's main functionalities?

Create an object with mirrored keys and values

This feature allows you to create an object where the keys are mirrored as values. This is useful for defining constants in a way that avoids typos and ensures consistency.

const keyMirror = require('keymirror');
const actionTypes = keyMirror({
  CREATE_USER: null,
  DELETE_USER: null,
  UPDATE_USER: null
});
console.log(actionTypes); // { CREATE_USER: 'CREATE_USER', DELETE_USER: 'DELETE_USER', UPDATE_USER: 'UPDATE_USER' }

Other packages similar to keymirror

FAQs

Package last updated on 21 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc